package shopping;
import java.util.Scanner;

/*public class Products{
     String name;
     String category;
     double price;
     int quantity;
}*/

public class Main {

    public static void main(String[] args) {
        Products[] shoppingCart=new Products[100];
        while (true){
            System.out.println("请您选择以下指令进行操作：");
            System.out.println("添加商品到购物车：add");
            System.out.println("查看购物的商品：check");
            System.out.println("修改购买的商品数量：update");
            System.out.println("结算商品的商品金额：pay");
            System.out.println("退出购物车：out");
            System.out.println("请输入您的指令：");

            Scanner scanner=new Scanner(System.in);
            String command=scanner.nextLine();
            switch (command){
                case "add":
                    addProducts(shoppingCart,scanner);
                    break;
                case "check":
                    checkProducts(shoppingCart);
                    break;
                case "update":
                    updateProducts(shoppingCart,scanner);
                    break;
                case "pay":
                    paysProducts(shoppingCart);
                    break;
                case "out":
                    return;
                default:
                    System.out.println("您输入的指令有误！");

            }
        }
    }
}